<template>
   <div class="wrap">
     <myHead :title="this.$route.query.title"></myHead>
     <div class="boxWrap">
       <img :src="info.url" alt="">
       <div class="msg">{{info.msg}}</div>
       <div class="smileMsg">{{info.smileMsg}}</div>
       <div class="btn" @click="jump(info.status)">{{info.btn}}</div>
     </div>
   </div>
</template>

<script>
  import myHead from "../../components/ClientComponents/lib/myHead";
  export default {
    name: "CertificationStatus",
    components:{
      myHead
    },
    data(){
      return {
        info:'',
        type:''
      }
    },
    created() {
      var arr = [{url:'../../../static/img/tuan@2x.png',msg:'资料审核中！',smileMsg:'平台将于3日内完成资料审核，并将审核结果以短信形式通知您 ！',btn:'返回首页',status:0},
          {url:'../../../static/img/shenfenzheng@2x.png',msg:'认证成功！',smileMsg:'恭喜您！您已完成实名认证，可返回查看。',btn:'去登录',status:1},
          {url:'../../../static/img/shibai@2x.png',msg:'账户认证失败！',smileMsg:'资料审核失败，请再次点击重新提交',btn:'重新提交',status:2}];
      this.info = arr[this.$route.query.status];
      console.log(this.info)
      this.type = this.$route.query.name;
      console.log(this.type)
    },
    methods:{
      jump(status) {
        var page;
        switch (status) {
            case 0:
              page = 'wantToCooperate';
              break;
            case 1:
              page = 'login';
              break;
            case 2:
              page = this.type;
              break;
        }

          if (page == 'CertificationStatus'){
              this.$myAxios('index/Horseman/again','post',{

              }).then(res=>{
                  this.$router.replace({
                      name:page
                  })
              })
          }else if (page == 'MerchantCertification') {
              this.$myAxios('index/Recruitment/again','post',{
                  user_id:this.$myStorage.query()
              }).then(res=>{
                  this.$router.replace({
                      name:page
                  })
              });
          }else {
            this.$router.replace({
              name:page
            })
          }
      }
    }
  }
</script>

<style scoped>
  .wrap {
    padding-top: .5rem;
  }
  .boxWrap {
    padding-top: .6rem;
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
  }
  .boxWrap>img {
    width: 1.66rem;
    max-height: 1.23rem;
    margin-bottom: .3rem;
  }
  .msg {
    font-size:.18rem;
    font-family:inpin heiti;
    font-weight:400;
    color:rgba(51,51,51,1);
    margin-bottom: .4rem;
  }
  .smileMsg {
    width: 55%;
    font-size:.14rem;
    font-family:inpin heiti;
    font-weight:400;
    color:rgba(153,153,153,1);
    margin-bottom: .35rem;
  }
  .btn {
    width:1.6rem;
    height:.44rem;
    background:linear-gradient(90deg,rgba(255,142,65,1),rgba(255,110,0,1));
    border:.01rem solid rgba(238,238,238,1);
    border-radius:.22rem;
    text-align: center;
    line-height: .44rem;
    color: #FFFFFF;
    font-size:.15rem;
    font-family:Adobe Heiti Std;
    font-weight:normal;
  }
</style>
